/*
 * @Author: Li Zengkun
 * @Date: 2022-09-09 14:08:15
 * @LastEditors: Li Zengkun
 * @LastEditTime: 2022-09-23 15:56:59
 * @Description: vuex/index.js
 */
import { createStore } from 'vuex'

import createPersistedState from 'vuex-persistedstate'
import Menu from "./modules/Menu"
import Account from "./modules/Account"
import User from "./modules/User"

export default createStore({
    modules: {
        Menu,
        Account,
        User
    },
    plugins: [
        createPersistedState({
            //key是存储数据的键名
            key: 'CMS-store',
            //paths是存储state中的那些数据，如果是模块下具体的数据需要加上模块名称，如user.token   
            path: ['menu']
        })
    ]
})